package com.xmut.mall.auth.feign;

import com.xmut.mall.auth.utils.RespBean;
import com.xmut.mall.auth.vo.LoginVo;
import com.xmut.mall.auth.vo.RegisterVo;
import com.xmut.mall.auth.vo.ResetPasswordVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("mall-member")
public interface MemberFeignService {

    /**
     * 注册用户
     * @param vo
     * @return
     */
    @PostMapping("/member/member/registerUser")
    RespBean registerUser(@RequestBody RegisterVo vo);

    /**
     * 用户登录
     * @param vo
     * @return
     */
    @PostMapping("/member/member/login")
    RespBean login(@RequestBody LoginVo vo);

    /**
     * 根据手机号码查询用户
     * @param phone
     * @return
     */
    @GetMapping("/member/member/getUserByPhone/{phone}")
    RespBean getUserByPhone(@PathVariable String phone);

    /**
     * 根据手机号码重置密码
     * @param vo
     * @return
     */
    @PostMapping("/member/member/resetPassword")
    RespBean resetPassword(@RequestBody ResetPasswordVo vo);

    @GetMapping("/member/member/testFeignUserAgent")
    RespBean testFeignUserAgent();
}
